void postorder(struct TreeNode* root ,int *result,int *resultSize)
{
    if(root==NULL)
    {
        return;
    }
    postorder(root->left,result,resultSize);
    postorder(root->right,result,resultSize);
    result[(*resultSize)++] = root->val;
}

int* postorderTraversal(struct TreeNode* root, int* returnSize) {
    *returnSize=0;
    int *result = malloc(sizeof(int)*2001);
    postorder(root,result,returnSize);
    return result;
}